<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<%@taglib prefix="priv" uri="/mytag/privilege"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>功能管理页面</title>
<script type="text/javascript" src="${path}/js/scripts/bootstart.js"></script>
</head>
<body style="width: 98%; height: 90%;">
	<div style="width: 100%;">
		<div class="mini-toolbar" style="border-bottom: 0; padding: 0px;">
			<table style="width: 100%;">
				<tr>
					<td style="width: 100%;"><priv:priv-btn btnname="add">
							<a class="mini-button" iconCls="icon-add"
								onclick="griddata.showAdd()">增加</a>
						</priv:priv-btn> <priv:priv-btn btnname="edit">
							<a class="mini-button" iconCls="icon-edit"
								onclick="griddata.showEdit()">修改</a>
						</priv:priv-btn> <priv:priv-btn btnname="remove">
							<a class="mini-button" iconCls="icon-remove"
								onclick="griddata.remove()">删除</a>
						</priv:priv-btn></td>
				</tr>
			</table>
		</div>
	</div>
	<div id="datagrid1" class="mini-datagrid"
		style="width: 100%; height: 92%;" dataField="list"
		url="${path}/function/mgr/showList" pageSize="100"
		totalField="totalRecord" allowResize="false" idField="functionId"
		multiSelect="true" showPager="false">
		<div property="columns">
			<div type="checkcolumn"></div>
			<div field="functionName" width="120" headerAlign="center"
				allowSort="true">功能名</div>
			<div field="code" width="120" headerAlign="center">代码</div>
			<div field="remark" width="120" headerAlign="center">描述</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="${path}/js/scripts/datagrid.js"></script>
<script type="text/javascript" src="${path}/js/scripts/utils.js"></script>
<script type="text/javascript" src="${path}/js/message.js"></script>
<script type="text/javascript">
	mini.parse();
	var doc = $(document);
	$(function() {
		$.grid.init({
			id : "datagrid1"
		});
		window.griddata = {};
		griddata.showAdd = function() {
			$.grid.add({
				url : "${path}/function/mgr/functionform",
				title : "增加功能按钮"
			});
		};
		griddata.showEdit = function() {
			$.grid.edit({
				url : "${path}/function/mgr/functionform",
				title : "功能按钮编辑",
				formId : "functionForm",
				fieldId : "functionId",
				dataUrl : "${path}/function/mgr/showUpdate"
			});
		};
		//删除功能按钮
		griddata.remove = function() {
			$.grid.remove({
				url : "${path}/function/mgr/deleteFunction",
				paramName : "key", //獲取參數的參數名
				showMsg : true,//是否显示提示信息（删除成功与否返回信息）
				fldId : "functionId" //获取选中列主键的对应字段名
			});
		};
	});
</script>
</html>